package cn.cxq.learning.e4;

import java.util.ArrayList;
import java.util.Scanner;

public class Client {

    public static void main(String[] args) {
        int n;
        ArrayList<double[]> M1M2 = new ArrayList<>(); // 用集合替代两个double数组
        Bisection bisection = new Bisection();
        double res;
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();

        for (int i = 0; i < n; i++) {
            double m1 = scanner.nextDouble();
            double m2 = scanner.nextDouble();
            M1M2.add(new double[]{m1,m2});
        }

        for (double[] m1m2 : M1M2) {
            res = bisection.BISECTION(m1m2[0], m1m2[1]);
            System.out.print(String.format("%.15f ",res));
            System.out.println();
        }


    }
}
